package nuc.soft.xsf.controller;


import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import nuc.soft.xsf.service.IMenuService;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/MenuController")
public class MenuController {
	@Resource
	private IMenuService menuService;

   @RequestMapping("/IndexAccessing.action")
	public String showIndex() {
		// 转向列表的action
		return "/index";
	}
   
   @RequestMapping(value = "/userList.action", produces = "text/html;charset=UTF-8")
    public String userList(){
	   return "/userPages/userList";
   }
   
   
   @RequestMapping(value = "/roleList.action", produces = "text/html;charset=UTF-8")
   public String roleList(){
	   return "/userPages/roleList";
  }
   
   @RequestMapping(value = "/titleList.action", produces = "text/html;charset=UTF-8")
   public String titleList(){
	   return "/testPages/titleList";
  }
   
   
   
   @RequestMapping(value = "/titleTypeList.action", produces = "text/html;charset=UTF-8")
   public String titleTypeList(){
	   return "/testPages/titleTypeList";
  }
   
   
   @RequestMapping(value = "/projectList.action", produces = "text/html;charset=UTF-8")
   public String projectList(){
	   return "/testPages/projectList";
  }
  
   @RequestMapping(value = "/insertProject.action", produces = "text/html;charset=UTF-8")
   public String insertProjectList(){
	   return "/testPages/project_file";
  }
   
   
   @RequestMapping(value = "/paperList.action", produces = "text/html;charset=UTF-8")
   public String insertpaperList(){
	   return "/testPages/paperList";
  }
   
  
   @RequestMapping(value = "/paper_detail.action", produces = "text/html;charset=UTF-8")
   public String  paper_detailList(){
	   return "/testPages/paperDetail";
  }
   
   @RequestMapping(value = "/reportList.action", produces = "text/html;charset=UTF-8")
   public String  reportList(){
	   return "/testPages/reportList";
   }
   
   
   @RequestMapping(value = "/report_detail.action", produces = "text/html;charset=UTF-8")
   public String  report_detailList(){
	   return "/testPages/reportDetail";
  }
   

   @RequestMapping(value = "/postList.action", produces = "text/html;charset=UTF-8")
   public String  postList(){
	   return "/contactPages/postList";
  }
   
   
   @RequestMapping(value = "/postListfront.action", produces = "text/html;charset=UTF-8")
   public String  postListfront(){
	   return "/contactPages/postListfront";
  }
   
   
   @RequestMapping(value = "/postDetail.action", produces = "text/html;charset=UTF-8")
   public String  postDetail(){
	   return "/contactPages/postDetail";
  }
   @RequestMapping(value="/postDetailFront.action",produces = "text/html;charset=UTF-8")
   public String postDetailFront(Integer postId)
   {
	   System.out.println(postId);
	   return "forward:/PostReplyController/findByConditionfront.action?postId="+postId;
   }
   
   @RequestMapping(value = "/dictionaryList.action", produces = "text/html;charset=UTF-8")
   public String dictionaryList(){
	   return "/systemConfigure/dictionaryList";
  }

  
   
   /**
	 * 权限树选项
	 * 
	 */
	@RequestMapping(value="/menuTree.action", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String menuTree(String userid) {
		Map map = new HashMap();
		String returnstr=menuService.findMenuList(map);
		return returnstr; 
	}
	
	 /**
		 * 权限树选项
		 * 
		 */
	@RequestMapping(value="/menuTree01.action", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String menuTree01(String userid) {
			Map map = new HashMap();
			String returnstr=menuService.findMenuList01(map);
			return returnstr; 
		}

	/**
	 * 权限树选项
	 * 
	 */
	@RequestMapping("/menuDesk.action")
	@ResponseBody
	public String menuDesk(String userid) {
		Map map = new HashMap();
		map.put("userid", 1);
		return menuService.findMenuDesk(map);
	}

	/**
	 * 权限树选项
	 * 
	 *//*
	@RequestMapping("/setDesk.action")
	@ResponseBody
	public void setDesk(String ids) {
		String[] id = ids.split(",");
		menuService.deleteDesk("1");
		for (int i = 0; i < id.length; i++) {
			Map map = new HashMap();
			map.put("userid", 1);
			map.put("menuid", id[i]);
			menuService.setDesk(map);
		}
	}*/
}
